package com.xpchenfrank.controller;

import com.xpchenfrank.common.response.RestResponse;
import com.xpchenfrank.entity.WsmSite;
import com.xpchenfrank.mapper.WsmCarMapper;
import com.xpchenfrank.mapper.WsmSiteMapper;
import com.xpchenfrank.service.StockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * 监控的网站的Controller
 *
 * @author xpchen
 * @time 2018/3/7 17:50
 * @Description
 * @copyright Wuxi Yazuo ,Ltd.copyright 2015-2025
 */
@Slf4j
@RestController
@RequestMapping("site")
public class SiteController {

    @Resource
    WsmSiteMapper wsmSiteMapper;

    @ResponseBody
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public RestResponse add(@RequestBody WsmSite wsmSite) {

        wsmSite.setCreateTime(LocalDateTime.now());
        wsmSiteMapper.insertSelective(wsmSite);
        return RestResponse.success();
    }
}
